<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="/static/common/header.jsp"%>
<%@include file="/static/common/easyui.jsp"%>
<%@include file="/static/common/common.jsp"%>
<link href="${ctx}/static/css/main.css" rel="stylesheet">
<base target="_self">
<script src="${ctx}/static/jquery/jquery.form.js" type="text/javascript"></script>

<script type="text/javascript">
	
	//客户信息校验
	function saveData() {
		//工单字段校验
		var orderId = $("#orderId").val();
		var dealFlag = $(":radio[name=dealFlag][checked]").val();
		if (dealFlag == null || dealFlag == '' || dealFlag == 'undefined') {
			$.messager.alert('提示', "请选择是否处理", 'info');
			return false;
		}
		var remark = $("#remark").val();
		
		//校验完成
		var data = {
			//工单信息
			orderId: orderId,
			dealFlag: dealFlag,
			remark: remark
		};
		
		$.postJSON("${ctx}/infobird/call/updateHistory", data, function(data) {
			if (data && data.success == "true") {
				$.messager.alert('提示', '保存成功', 'info');
				window.returnValue="Y";
				setTimeout("closeWin();", 1000)
			} else {
				$.messager.alert('提示', data.err_msg, 'info');
			}
		});
	}

	function clearData() {
		var radioes = document.getElementsByName("dealFlag");
		for ( var i = 0; i < radioes.length; i++) {
			if (radioes[i].checked) {
				radioes[i].checked = false;
				break;
			}
		}
		
		$('#remark').val("");
	}
	
	function closeWin() {
		window.close();
	}

	$(document).ready(
		function() {
			changeCls();
	})
	
	function changeCls() {
		var flag = $('#opt').val();
		$('#certType').combobox({
			disabled : true
		});
		$('#birth').datebox({
			disabled : true
		});
	}
</script>




</script>

</head>

<body onkeydown="if (event.keyCode==116){reload.click()}">

	<div id="J_Form">

		<form id="recordForm" name="recordForm" method="post">
			<!-- 隐藏域 -->
			<input type="hidden" id="custId" name="custId" value="${cust.id }">
			<input type="hidden" id="orderId" name="orderId" value="${order.id}">
			<input type="hidden" id="recordId" name="recordId" value="${order.recordId}">
			<input type="hidden" id="parentId" name="parentId" value="${order.parentBusinessId}">
			<input type="hidden" id="sonId" name="sonId" value="${order.businessId}">
			<input type="hidden" id="opt" name="opt" value="${opt}">

			<!-- 客户类型选择 -->
			<table class="listTable">
				<tr>
					<th width="117px"><font color="red">&nbsp;&nbsp;*&nbsp;&nbsp;</font>客户类型：</th>
					<td width="1160px">
						<div class="fl">
							<input type="radio" name="custType" value="1" disabled="disabled"
								<c:if test="${cust.custType eq '1' }">checked="checked"</c:if> />
							服务机构&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<div class="fl">
							<input type="radio" name="custType" value="2" disabled="disabled"
								<c:if test="${cust.custType eq '2' }">checked="checked"</c:if> />
							已开户客户&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<div class="fl">
							<input type="radio" name="custType" value="3" disabled="disabled"
								<c:if test="${cust.custType eq '3' }">checked="checked"</c:if> />
							未开户客户&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<div class="fl">
							<input type="radio" name="custType" value="4" disabled="disabled"
								<c:if test="${cust.custType eq '4' }">checked="checked"</c:if> />
							批发商&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<div class="fl">
							<input type="radio" name="custType" value="5" disabled="disabled"
								<c:if test="${cust.custType eq '5' }">checked="checked"</c:if> />
							其他&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
					</td>
				</tr>
			</table>

			<div style="height: 10px;"></div>

			<!-- 联系人信息 -->
			<table id="customerInfo" class="listTable" style="width: 100%">
				<caption>联系人信息</caption>
				<tbody>
					<tr>
						<th width="125px">姓名：</th>
						<td width="220px">
							<input type="text" id="name" name="name" value="${cust.name}" disabled="disabled">
						</td>
						<th width="120px">性别：</th>
						<td width="180px">
							<input type="radio" name="sex" value="M" disabled="disabled"
							<c:if test="${cust.sex eq 'M' }">checked="checked"</c:if> />
							男&nbsp;&nbsp;&nbsp;&nbsp; 
							<input type="radio" name="sex" value="F" disabled="disabled"
							<c:if test="${cust.sex eq 'F' }">checked="checked"</c:if> />
							女
						</td>
						<th width="120px">手机号码：</th>
						<td width="180px">
							<c:if test="${empty cust.mobile && custFlag=='N' }">
								<input type="text" id="mobile" name="mobile" value="${cust.mobile}" />
							</c:if>
							<c:if test="${!empty cust.mobile || custFlag=='Y'}">
								<input type="text" id="mobile" name="mobile" value="${cust.mobile}" disabled="disabled" />
							</c:if>
						</td>
						<th width="120px">交易账号：</th>
						<td width="180px">
							<input type="text" id="acctNo" name="acctNo" value="${cust.acctNo}" disabled="disabled">
						</td>
					</tr>
					<tr>
						<th width="120px">证件号码：</th>
						<td width="260px">
							<select name="certType" id="certType" class="easyui-combobox">
								<c:forEach items="${dicList}" var="dic">
									<option value="${dic.dicValue}"
										<c:if test="${cust.certType eq dic.dicValue }">selected="selected"</c:if>>${dic.dicName}</option>
								</c:forEach>
							</select>
						 	-
						 	<input type="text" id="certNo" name="certNo" value="${cust.certNo}" disabled="disabled"
								onchange="ExtractionBirthday('certNo', 'birth')"  />
						</td>
						<th width="120px">出生日期：</th>
						<td width="180px">
							<input id="birth" name="birth" value="${cust.birthDay}" class="easyui-datebox"
								style="width: 150px;" />
						</td>
						<th width="120px">固定电话：</th>
						<td width="180px">
							<input type="text" id="telephone" name="telephone" value="${cust.telephone}" disabled="disabled" />
						</td>
						<th width="120px">传真号码：</th>
						<td width="180px">
							<input type="text" id="fax" name="fax" value="${cust.fax}" disabled="disabled"/>
						</td>
					</tr>
					<tr>
						<th width="120px">号码归属地：</th>
						<td width="220px">
							<input type="hidden" id="province" name="province" value="${cust.province}">
							<input type="hidden" id="city" name="city" value="${cust.city}">
							<input type="text" id="dependency" name="dependency" value="${cust.dependency}" disabled="disabled">
						</td>
						<th width="120px">电子邮件：</th>
						<td width="180px">
							<input type="text" id="email" name="email" value="${cust.email}" disabled="disabled">
						</td>
						<th width="120px">通讯地址：</th>
						<td width="180px">
							<input type="text" id="address" name="address" value="${cust.address}" disabled="disabled">
						</td>

						<th width="120px">邮编：</th>
						<td width="180px">
							<input type="text" id="zipCode" name="zipCode" value="${cust.zipCode}" disabled="disabled">
						</td>
					</tr>
				</tbody>
			</table>

			<div class="height10"></div>

			<!-- 话务信息 -->
			<table id="callInfo" class="listTable" style="width: 100%">
				<caption>话务信息</caption>
				<tbody>
					<tr>
						<th width="140px">工单编号：</th>
						<td>
							<input type="text" id="orderNo" name="orderNo" value="${order.orderNo}" disabled="disabled">
						</td>
					</tr>
					<tr>
						<th width="140px">原业务类型：</th>
						<td>
							${order.businessFlow}
						</td>
					</tr>
					<c:if test="${opt=='VIEW'}">
					<tr>
						<th width="140px">备注：</th>
						<td colspan="7"><textarea rows="3" cols="120" name="remark" disabled="disabled"
								id="remark" value="${order.remark}">${order.remark}</textarea></td>
					</tr>
					
					<tr>
						<th width="140px"><font color="red">&nbsp;&nbsp;*&nbsp;&nbsp;</font>是否处理：</th>
						<td colspan="7">
							<input type="radio" name="dealFlag" value="Y" disabled="disabled"
							<c:if test="${order.dealFlag eq 'Y' }">checked="checked"</c:if> />
							是&nbsp;&nbsp;&nbsp;&nbsp; 
							<input type="radio" name="dealFlag" value="N" disabled="disabled"
							<c:if test="${order.dealFlag eq 'N' }">checked="checked"</c:if> />
							否
						</td>
					</tr>
					</c:if>
					<c:if test="${opt=='DEAL'}">
					<tr>
						<th width="140px">备注：</th>
						<td colspan="7"><textarea rows="3" cols="120" name="remark"
								id="remark" value="${order.remark}">${order.remark}</textarea></td>
					</tr>
					<tr>
						<th width="140px"><font color="red">&nbsp;&nbsp;*&nbsp;&nbsp;</font>是否处理：</th>
						<td colspan="7">
							<input type="radio" name="dealFlag" value="Y"
							<c:if test="${order.dealFlag eq 'Y' }">checked="checked"</c:if> />
							是&nbsp;&nbsp;&nbsp;&nbsp; 
							<input type="radio" name="dealFlag" value="N"
							<c:if test="${order.dealFlag eq 'N' }">checked="checked"</c:if> />
							否
						</td>
					</tr>
					</c:if>
				</tbody>
			</table>
			
				<div
					style="text-align: center; padding: 5px; margin-top: 5px; margin-bottom: 5px;">
					<c:if test="${opt=='DEAL'}">
					<a href="javascript:void(0);" id="btn-save" onclick="saveData();"
						class="easyui-linkbutton" iconCls="icon-ok">处理完成</a>&nbsp;&nbsp;&nbsp;&nbsp;
					</c:if>
					<a href="javascript:void(0);" id="btn-back" onclick="closeWin();"
						class="easyui-linkbutton" iconCls="icon-back">关闭</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>

			<div style="height: 10px;"></div>

		</form>

	</div>

</body>

</html>